

    \filetitle{sstate}{Compute steady state or balance-growth path of the model}{model/sstate}

	\paragraph{Syntax}

\begin{verbatim}
[M,Flag] = sstate(M,...)
\end{verbatim}

\paragraph{Input arguments}

\begin{itemize}
\tightlist
\item
  \texttt{M} {[} model {]} - Parameterised model object.
\end{itemize}

\paragraph{Output arguments}

\begin{itemize}
\item
  \texttt{M} {[} model {]} - Model object with newly computed steady
  state assigned.
\item
  \texttt{Flag} {[} \texttt{true} \textbar{} \texttt{false} {]} - True
  for parameterizations where steady state has been found successfully.
\end{itemize}

\paragraph{Options}

\begin{itemize}
\item
  \texttt{\textquotesingle{}linear=\textquotesingle{}} {[}
  \emph{\texttt{@auto}} \textbar{} \texttt{true} \textbar{}
  \texttt{false} {]} - Solve for steady state using a linear approach,
  i.e.~based on the first-order solution matrices and the vector of
  constants.
\item
  \texttt{\textquotesingle{}warning=\textquotesingle{}} {[}
  \emph{\texttt{true}} \textbar{} \texttt{false} {]} - Display IRIS
  warning produced by this function.
\end{itemize}

\subparagraph{Options for nonlinear
models}

\begin{itemize}
\item
  \texttt{\textquotesingle{}blocks=\textquotesingle{}} {[}
  \emph{\texttt{true}} \textbar{} \texttt{false} {]} - Re-arrarnge
  steady-state equations in recursive blocks before computing steady
  state.
\item
  \texttt{\textquotesingle{}display=\textquotesingle{}} {[}
  \emph{\texttt{\textquotesingle{}iter\textquotesingle{}}} \textbar{}
  \texttt{\textquotesingle{}final\textquotesingle{}} \textbar{}
  \texttt{\textquotesingle{}notify\textquotesingle{}} \textbar{}
  \texttt{\textquotesingle{}off\textquotesingle{}} {]} - Level of screen
  output, see Optim Tbx.
\item
  \texttt{\textquotesingle{}endogenise=\textquotesingle{}} {[} cellstr
  \textbar{} char \textbar{} \emph{empty} {]} - List of parameters that
  will be endogenised when computing the steady state; the number of
  endogenised parameters must match the number of transtion variables
  exogenised in the
  \texttt{\textquotesingle{}exogenised=\textquotesingle{}} option.
\item
  \texttt{\textquotesingle{}exogenise=\textquotesingle{}} {[} cellstr
  \textbar{} char \textbar{} \emph{empty} {]} - List of transition
  variables that will be exogenised when computing the steady state; the
  number of exogenised variables must match the number of parameters
  exogenised in the
  \texttt{\textquotesingle{}exogenise=\textquotesingle{}} option.
\item
  \texttt{\textquotesingle{}fix=\textquotesingle{}} {[} cellstr
  \textbar{} \emph{empty} {]} - List of variables whose steady state
  will not be computed and kept fixed to the currently assigned values.
\item
  \texttt{\textquotesingle{}fixAllBut=\textquotesingle{}} {[} cellstr
  \textbar{} \emph{empty} {]} - Inverse list of variables whose steady
  state will not be computed and kept fixed to the currently assigned
  values.
\item
  \texttt{\textquotesingle{}fixGrowth=\textquotesingle{}} {[} cellstr
  \textbar{} \emph{empty} {]} - List of variables whose steady-state
  growth will not be computed and kept fixed to the currently assigned
  values.
\item
  \texttt{\textquotesingle{}fixGrowthAllBut=\textquotesingle{}} {[}
  cellstr \textbar{} \emph{empty} {]} - Inverse list of variables whose
  steady-state growth will not be computed and kept fixed to the
  currently assigned values.
\item
  \texttt{\textquotesingle{}fixLevel=\textquotesingle{}} {[} cellstr
  \textbar{} \emph{empty} {]} - List of variables whose steady-state
  levels will not be computed and kept fixed to the currently assigned
  values.
\item
  \texttt{\textquotesingle{}fixLevelAllBut=\textquotesingle{}} {[}
  cellstr \textbar{} \emph{empty} {]} - Inverse list of variables whose
  steady-state levels will not be computed and kept fixed to the
  currently assigned values.
\item
  \texttt{\textquotesingle{}growth=\textquotesingle{}} {[} \texttt{true}
  \textbar{} \emph{\texttt{false}} {]} - If \texttt{true}, both the
  steady-state levels and growth rates will be computed; if
  \texttt{false}, only the levels will be computed assuming that the
  model is either stationary or that the correct steady-state growth
  rates are already assigned in the model object.
\item
  \texttt{\textquotesingle{}logMinus=\textquotesingle{}} {[} cell
  \textbar{} char \textbar{} \emph{empty} {]} - List of log variables
  whose steady state will be restricted to negative values in this run
  of \texttt{sstate}.
\item
  \texttt{\textquotesingle{}optimSet=\textquotesingle{}} {[} cell
  \textbar{} struct \textbar{} \emph{empty} {]} - Name-value pairs in a
  cell array or struct to supply Optim Tbx settings; see
  \texttt{help\ optimset} for details on these settings.
\item
  \texttt{\textquotesingle{}reuse=\textquotesingle{}} {[} \texttt{true}
  \textbar{} \emph{\texttt{false}} {]} - Reuse the steady-state values
  calculated for a parameterisation to initialise the next
  parameterisation.
\item
  \texttt{\textquotesingle{}solver=\textquotesingle{}} {[}
  \texttt{\textquotesingle{}fsolve\textquotesingle{}} \textbar{}
  \emph{\texttt{\textquotesingle{}lsqnonlin\textquotesingle{}}} {]} -
  Numerical routine to solve for steady state of nonlinear models; it
  can be one of the two Optimization Tbx functions.
\item
  \texttt{\textquotesingle{}sstate=\textquotesingle{}} {[} \texttt{true}
  \textbar{} \emph{\texttt{false}} \textbar{} cell {]} - If
  \texttt{true} or a cell array, the steady state is re-computed in each
  iteration; the cell array can be used to modify the default options
  with which the \texttt{sstate} function is called.
\item
  \texttt{\textquotesingle{}unlog=\textquotesingle{}} {[} cell
  \textbar{} char \textbar{} \emph{empty} {]} - List of log variables
  that will be temporarily treated as non-log variables in this run of
  \texttt{sstate}, i.e.~their steady-state levels will not be restricted
  to either positive or negative values.
\end{itemize}

\subparagraph{Options for linear
models}

\begin{itemize}
\tightlist
\item
  \texttt{\textquotesingle{}solve=\textquotesingle{}} {[} \texttt{true}
  \textbar{} \emph{\texttt{false}} {]} - Solve model before computing
  steady state.
\end{itemize}

\paragraph{Description}

\subparagraph{Non-stationary models}

For backward compatibility, the option
\texttt{\textquotesingle{}growth=\textquotesingle{}} is set to
\texttt{false} by default so that either the model is assumed stationary
or the steady-state growth rates have been already pre-assigned to the
model object. To use the \texttt{sstate} function for computing both the
steady-state levels and steady-state growth rates in a balanced-growth
model, you need to set the option
\texttt{\textquotesingle{}growth=\textquotesingle{}\ true}.

\subparagraph{Lower and upper bounds}

Use options \texttt{\textquotesingle{}levelBounds=\textquotesingle{}}
and \texttt{\textquotesingle{}growthBounds=\textquotesingle{}} to impose
lower and/or upper bounds on steady-state levels and/or growth rates of
selected variables. Create a struct with a 1-by-2 vector
\texttt{{[}lowerBnd,upperBnd{]}} for each variable that is supposed to
be bounded when the steady state is being calculated, and pass the
struct into the respective option. User \texttt{-Inf} or \texttt{Inf} if
only one of the bounds is specified. For instance, the following piece
of code

\begin{verbatim}
bnd = struct();
bnd.X = [0,10];
bnd.Y = [-Inf,20];
bnd.Z = [5,Inf];
\end{verbatim}

specifies lower bounds for variables \texttt{X} and \texttt{Z}, and
upper bounds for variables \texttt{X} and \texttt{Y}. The variables that
are not bounded do not need to be included in the struct.

\paragraph{Example}


